The present technique relates to mechanisms for generating an error code that can be stored with associated data in memory to enable later detection and/or correction of errors. For example, such an error code can be used to detect situations where the associated data has been corrupted, due for example to a soft or a hard error.
Dependent on the error code scheme employed, such error codes may only allow errors in a certain number of bits to be detected, but not corrected, or alternatively may allow errors in a certain number of bits to be detected, but also enable errors in a reduced number of bits to be corrected. Generally, whether the error codes solely provide for detection of errors, or also provide for correction of errors, those error codes are referred to as error correction codes (ECCs).
In modern data processing systems there may be a number of requirements for the types of errors that need to be detected and/or corrected. For instance, considering a data value to be stored within memory (herein such a data value also being referred to as a datum), the error code generated for storing in association with that datum may not only be required to enable errors in the datum to be detected and/or corrected. For example, it may also be desired to use the error code to detect situations where the memory output obtained during a read operation is stuck at all zeros or stuck at all ones.
However, in addition, it may be desirable to use the error code to seek to detect faults in the memory address decoding operation, which may result in the contents returned from the memory having the correct integrity, but the wrong address having been accessed. To achieve such memory address decoding protection, it is possible to use both the datum and the address when generating the error code stored in memory. Then, when the datum is read from memory, the read address and datum are used to generate another error code that can be checked against the error code read from memory in association with the datum.
Whilst such an approach can provide an effective mechanism for detecting faults in the memory address decoding, it compromises the ability to detect situations where the memory output is stuck at all zeros or stuck at all ones, due to the fact that the address is used in combination with the datum when generating the code, and the address can have any arbitrary value relative to the datum.
Accordingly, it would be desirable to provide an improved mechanism for generating an error code for a block (also referred to herein as a chunk) comprising a plurality of data bits and a plurality of address bits, that allows memory address decode faults to be detected whilst also allowing detection of stuck at zero or stuck at one faults in a memory's output.